<template>
	<view class='cu-modal bottom-modal' :class='{show: show}'>
		<view class='modal'>
			<view class='list'>
				<!-- #ifdef MP-WEIXIN -->
				<!-- <button class='item' open-type='share' v-for='(item, index) in list'> -->
				<!-- #endif -->
				<button class='item' v-for='(item, index) in list' @click='handleShare(item)'>
					<view class='icon'>
						<image :src='item.icon'></image>
					</view>
					<text>{{item.name}}</text>
				</button>
			</view>
			<view class='btn' @click='handleClose'>取消</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"share-modal",
		data() {
			return {
				show: false,
				params: {},
				list: [
					// {
					// 	icon: '/static/icon/share-wx.png',
					// 	name: '微信',
					// 	provider: 'weixin',
					// 	type: 1, 
					// 	href: '',
					// 	scene: "WXSceneSession"
					// },
					
					{
						icon: '/static/icon/zfb.png',
						name: '支付宝',
						provider: 'zfb',
						type: 2, 
						href: '',
						scene: "WXSceneSession"
					}
				]
			};
		},
		created() {
		
		},
		methods: {
			handleOpen(params) {
				this.show = true;
			},
			handleClose() {
				this.show = false;
			},
			handleShare(item) {
				this.$emit('handleShare',item)
			}
		}
	}
</script>

<style scoped lang="scss">
	.modal {
		width: 100%;
		position: absolute;
		bottom: 0;
		left: 0;
		background: #EFEEEC;
		border-radius: 8rpx 0;
		padding: 0 64rpx 64rpx 64rpx;

		
		.list {
			padding: 82rpx 0 58rpx 0;
			margin-right: -58rpx;
			display: flex;
			
			.item {
				width: 116rpx;
				margin-right: 58rpx;
				display: flex;
				flex-direction: column;
				align-items: center;
				margin-left: 0;
				padding: 0;
				line-height: 1;
				background: transparent;
				
				&:after {
					border: 0;
					background: transparent;
				}
				
				.icon {
					width: 116rpx;
					height: 116rpx;
					background: #fff;
					display: flex;
					align-items: center;
					justify-content: center;
					border-radius: 22rpx;
					
					image {
						width: 76rpx;
						height: 76rpx;
					}
				}
				
				text {
					font-size: 24rpx;
					margin-top: 24rpx;
				}
			}
		}
		
		.btn {
			width: 100%;
			height: 80rpx;
			line-height: 80rpx;
			background: #FFFFFF;
			border-radius: 50rpx;
			text-align: center;
		}
	}
</style>